from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager

from run import app
from xtoad.models import db, User, Role

migrate = Migrate(app=app, db=db)

manager = Manager(app=app)
manager.add_command('db', MigrateCommand)

if __name__ == '__main__':
    manager.run()
    db.create_all()
